﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

using ProjectPigs.Assets;
using ProjectPigs.Scenes;

namespace ProjectPigs.Core
{
    abstract public class RenderableGameObject : GameObject
    {
   
        PPModel model;
        protected Transform transform;

        public PPModel Model { get { return model; } set { model = value; } }
        public Transform Transform { get { return transform; } set { transform = value; } }

        public RenderableGameObject(String ID, PPModel model, Transform transform)
            : base(ID)
        {
            this.transform = new Transform();
            this.transform.setPosition_X(transform.Position.X);
            this.transform.setPosition_Y(transform.Position.Y);
            this.transform.setPosition_Z(transform.Position.Z);
            this.transform.setRotation_X(transform.Rotation.X);
            this.transform.setRotation_Y(transform.Rotation.Y);
            this.transform.setRotation_Z(transform.Rotation.Z);
            this.transform.setScale_X(transform.Scale.X);
            this.transform.setScale_Y(transform.Scale.Y);
            this.transform.setScale_Z(transform.Scale.Z);
            this.model = model;
        }

        public void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            //transform.setPosition_X(transform.Position.X + 0.1f);
            //Call renderer
            //Debug.pushEntry("ID " + _ID + " " + Transform.Position.X + ", " + Transform.Position.Y + ", " + Transform.Position.Z, 2);
            Renderer.drawMesh(this);
        }
 
    }
}
